package com.starlink.model.util;

import com.starlink.model.dtomapper.SchoolbagSpecificationDtoMapper;
import com.starlink.model.domain.SchoolbagSpecificationDO;
import com.starlink.model.vo.SchoolbagSpecificationVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class SchoolbagSpecificationConvert {

    public static List<SchoolbagSpecificationVO> buildSchoolbagSpecificationVoList(List<SchoolbagSpecificationDO> schoolbagSpecificationDOList) {
        if (CollectionUtils.isEmpty(schoolbagSpecificationDOList)) {
            return Lists.newArrayList();
        }
        List<SchoolbagSpecificationVO> schoolbagSpecificationVOList = new ArrayList<>();
        for (SchoolbagSpecificationDO schoolbagSpecificationDO : schoolbagSpecificationDOList) {
            schoolbagSpecificationVOList.add(SchoolbagSpecificationDtoMapper.INSTANCE.do2VO(schoolbagSpecificationDO));
        }

        return schoolbagSpecificationVOList;
    }
}
